/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package smaragJava;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author northpole
 */
public class SpeciesDAO implements SpeciesDAOInterface{

	Connector con;
	
	public SpeciesDAO(Connector con){
		this.con = con;
	}
	
     /* (non-Javadoc)
	 * @see smaragJava.SpeciesDAOInterface#insert(smaragJava.Species)
	 */
    public void insert(Species species){
    	 String query;
 		Statement s;
 		String [] values = {species.getName(), species.getCategory().toString(), species.getFamily(), species.getCreator().toString(), species.getHot_species().toString()};
 		
 		query = con.abstractInsert("species", values);
 		try{
 			s = con.getConnection().createStatement();
 			s.executeUpdate(query);
 			s.close();
 		}
 		catch(SQLException e){
 			e.printStackTrace();
 		}
   }
//    throws CustomerDAOException;

   /* (non-Javadoc)
 * @see smaragJava.SpeciesDAOInterface#update(smaragJava.Species)
 */
public void update(Species species/*, species id*/){
    throw new UnsupportedOperationException("Not yet implemented");
   }
  // throws CustomerDAOException;

  /* (non-Javadoc)
 * @see smaragJava.SpeciesDAOInterface#delete(smaragJava.Species)
 */
public void delete(Species species/*, species ,id*/){
    throw new UnsupportedOperationException("Not yet implemented");
  }

    /* (non-Javadoc)
	 * @see smaragJava.SpeciesDAOInterface#findAll()
	 */
    public Species[] findAll(){
     throw new UnsupportedOperationException("Not yet implemented");
   }
   // throws CustomerDAOException;

   /* (non-Javadoc)
 * @see smaragJava.SpeciesDAOInterface#findByPrimaryKey(java.lang.String)
 */
public Species findByPrimaryKey(String id){
        throw new UnsupportedOperationException("Not yet implemented");
   }
  // throws CustomerDAOException;

  /* (non-Javadoc)
 * @see smaragJava.SpeciesDAOInterface#findBySpeciesname(java.lang.String)
 */
public Species[] findBySpeciesname(String speciesname){
   throw new UnsupportedOperationException("Not yet implemented");
  }
}
